import request from '@/utils/request'

//查询计划导入的数据
export function getPlan(data) {
  return request({
    url: '/produce/materialScheduling/getPlan',
    method: 'get',
    params: data
  })
}

// 查询明细计划自动排程
export function listMof(query) {
  return request({
    url: '/produce/materialScheduling/list',
    method: 'get',
    params: query
  })
}

// 查询明细计划自动排程
export function listMofConfirm(query) {
  return request({
    url: '/produce/materialScheduling/listConfirm',
    method: 'get',
    params: query
  })
}

//添加计划导入的数据
export function addPlan(data) {
  return request({
    url: '/produce/materialScheduling/surePlan',
    method: 'post',
    data: data
  })
}

//自动排程
export function autoSchedule() {
  return request({
    url: '/produce/materialScheduling/autoSchedule',
    method: 'put'
  })
}

//删除
export function delMofMstr(mofId) {
  return request({
    url: '/produce/materialScheduling/delMofMstr/' + mofId,
    method: 'delete'
  })
}

//根据制造单号获取信息
export function getMofMjmByZzdh(mofZzdh) {
  return request({
    url: '/produce/materialScheduling/getMofMjmByZzdh/' + mofZzdh,
    method: 'get'
  })
}

export function updateMof(data) {
  return request({
    url: '/produce/materialScheduling/updateMof',
    method: 'put',
    data: data,
    repeatSubmit: true
  })
}

export function confirmMof(ids) {
  return request({
    url: '/produce/materialScheduling/confirmMof/' + ids,
    method: 'put',
    repeatSubmit: true
  })
}

//明细计划发送作业
//查询
export function getSendList(query) {
  return request({
    url: '/produce/materialScheduling/getSendList',
    method: 'get',
    params: query
  })
}

//检验是否适合排入此机台
export function sendCheck(query) {
  return request({
    url: '/produce/materialScheduling/sendCheck',
    method: 'get',
    params:query
  })
}


export function removeSend(mofIds) {
  return request({
    url: '/produce/materialScheduling/removeSend/' + mofIds,
    method: 'delete'
  })
}
export function send(sendMof) {
  return request({
    url: '/produce/materialScheduling/send' ,
    method: 'put',
    data:sendMof
  })
}


